package model.game;

import java.util.ArrayList;
import java.util.Collections;

import model.Card;
import model.Permanent;


public class Player {

	ArrayList<Card> deck;
	ArrayList<Card> hand;
	ArrayList<Card> graveyard;
	ArrayList<Permanent> field;
	
	boolean isUser;
	
	Game game;
	
	public Player(ArrayList<Card> deck, boolean isUser){
		this.deck = deck;
		this.hand = new ArrayList<Card>();
		this.graveyard = new ArrayList<Card>();
		this.field = new ArrayList<Permanent>();
		this.isUser = isUser;
	}
	
	public void shuffleAndDraw(){
		Collections.shuffle(deck);
		for (int i = 0; i < 7; i++){
			draw();
		}
	}
	
	public void draw(){
		if (deck.size() == 0){
			game.end(!isUser);
			//TODO just lost the game
		}
		Card drawn = deck.remove(0);
		hand.add(drawn);
	}
	
}
